﻿#region

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BuXiaChu.OrderDishes.Model;
using BuXiaChu.OrderDishes.DAL;

#endregion

namespace BuXiaChu.OrderDishes.BLL
{
    public class EmployeesManager
    {
        /// <summary>
        /// Insert Or Update
        /// </summary>
        public static bool Save(EmployeesModel obj)
        {
            return EmployeesDAL.Save(obj);
        }

        public static EmployeesModel GetEmployeesById(int id)
        {
            return EmployeesDAL.GetEmployeesById(id);
        }

        public static bool Delete(int id)
        {
            return EmployeesDAL.Delete(id);
        }

        public static List<EmployeesModel> Search(string sqlWhere, int pageIndex, int pageSize, out int pageCount)
        {
            return EmployeesDAL.Search(sqlWhere, pageIndex, pageSize, out pageCount);
        }

        public static List<EmployeesModel> GetListByIds(string ids)
        {
            int pageCount = 0;
            var sqlWhere = " id in(" + ids.Trim(',') + ")";
            return EmployeesDAL.Search(sqlWhere, 0, 0, out pageCount);
        }

        public static List<EmployeesModel> GetEmployeesByJobTitle(int jobTitle)
        {
            return EmployeesDAL.GetEmployeesByJobTitle(jobTitle);
        }
    }
}
